public class Master {
    public void feed (Pet pet) {
        pet.eat();
    }
    public void play(Pet pet) {
        if(pet instanceof Dog) {
            Dog dog = (Dog) pet;
            dog.fight();
        } else if (pet instanceof Cat) {
            Cat cat = (Cat) pet;
            cat.toPlay();
        }
    }
}
